Skip to content

test(tools): compare child cwd against its real path - #47

Merged
ralyodio merged 1 commit into
moshcoder:mainfrom
khipu-agent:fix/tools-test-realpath
Jul 26, 2026
Merged

test(tools): compare child cwd against its real path#47
ralyodio merged 1 commit into
moshcoder:mainfrom
khipu-agent:fix/tools-test-realpath

Conversation

@khipu-agent

Copy link
Copy Markdown
Contributor

Bug

node --test fails on a fresh clone on macOS:

test/tools.test.mjs › passthrough preserves cwd
AssertionError: '/private/var/folders/…' === '/var/folders/…'

os.tmpdir() on macOS returns /var/…, which is a symlink to /private/var/…. The child process reports its physical cwd, while the test compared against the symlinked path — so the suite was red out-of-the-box on macOS (Linux CI stayed green, hiding it).

Fix

Compare against realpathSync(cwd) instead. No-op on Linux, correct on macOS.

Full suite after fix: 160/160 passing.

The passthrough test compared the child's process.cwd() (a resolved physical
path) against the symlinked temp dir spelling, so the suite was red on macOS
where os.tmpdir() is /var/... (a symlink to /private/var/...). Compare against
realpathSync(cwd) — a no-op on platforms without the symlink.
@ralyodio
ralyodio merged commit c6459ae into moshcoder:main Jul 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants